3.3.31 \(\int \frac {\tan ^4(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\) [231]

3.3.31.1 Optimal result
3.3.31.2 Mathematica [A] (verified)
3.3.31.3 Rubi [A] (verified)
3.3.31.4 Maple [A] (verified)
3.3.31.5 Fricas [A] (verification not implemented)
3.3.31.6 Sympy [B] (verification not implemented)
3.3.31.7 Maxima [A] (verification not implemented)
3.3.31.8 Giac [A] (verification not implemented)
3.3.31.9 Mupad [B] (verification not implemented)

3.3.31.1 Optimal result

Integrand size = 23, antiderivative size = 95 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {x}{(a-b)^2}+\frac {\sqrt {a} (a-3 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 (a-b)^2 b^{3/2} f}-\frac {a \tan (e+f x)}{2 (a-b) b f \left (a+b \tan ^2(e+f x)\right )} \]

output
x/(a-b)^2+1/2*(a-3*b)*arctan(b^(1/2)*tan(f*x+e)/a^(1/2))*a^(1/2)/(a-b)^2/b 
^(3/2)/f-1/2*a*tan(f*x+e)/(a-b)/b/f/(a+b*tan(f*x+e)^2)
 
3.3.31.2 Mathematica [A] (verified)

Time = 0.84 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.99 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {2 (e+f x)+\frac {\sqrt {a} (a-3 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{b^{3/2}}-\frac {a (a-b) \sin (2 (e+f x))}{b (a+b+(a-b) \cos (2 (e+f x)))}}{2 (a-b)^2 f} \]

input
Integrate[Tan[e + f*x]^4/(a + b*Tan[e + f*x]^2)^2,x]
 
output
(2*(e + f*x) + (Sqrt[a]*(a - 3*b)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/ 
b^(3/2) - (a*(a - b)*Sin[2*(e + f*x)])/(b*(a + b + (a - b)*Cos[2*(e + f*x) 
])))/(2*(a - b)^2*f)
 
3.3.31.3 Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.19, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4153, 372, 397, 216, 218}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\tan (e+f x)^4}{\left (a+b \tan (e+f x)^2\right )^2}dx\)

\(\Big \downarrow \) 4153

\(\displaystyle \frac {\int \frac {\tan ^4(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )^2}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 372

\(\displaystyle \frac {\frac {\int \frac {(a-2 b) \tan ^2(e+f x)+a}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{2 b (a-b)}-\frac {a \tan (e+f x)}{2 b (a-b) \left (a+b \tan ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 397

\(\displaystyle \frac {\frac {\frac {2 b \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a-b}+\frac {a (a-3 b) \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{2 b (a-b)}-\frac {a \tan (e+f x)}{2 b (a-b) \left (a+b \tan ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {\frac {a (a-3 b) \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}+\frac {2 b \arctan (\tan (e+f x))}{a-b}}{2 b (a-b)}-\frac {a \tan (e+f x)}{2 b (a-b) \left (a+b \tan ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\frac {2 b \arctan (\tan (e+f x))}{a-b}+\frac {\sqrt {a} (a-3 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {b} (a-b)}}{2 b (a-b)}-\frac {a \tan (e+f x)}{2 b (a-b) \left (a+b \tan ^2(e+f x)\right )}}{f}\)

input
Int[Tan[e + f*x]^4/(a + b*Tan[e + f*x]^2)^2,x]
 
output
(((2*b*ArcTan[Tan[e + f*x]])/(a - b) + (Sqrt[a]*(a - 3*b)*ArcTan[(Sqrt[b]* 
Tan[e + f*x])/Sqrt[a]])/((a - b)*Sqrt[b]))/(2*(a - b)*b) - (a*Tan[e + f*x] 
)/(2*(a - b)*b*(a + b*Tan[e + f*x]^2)))/f
 

3.3.31.3.1 Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 372
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[(-a)*e^3*(e*x)^(m - 3)*(a + b*x^2)^(p + 1)*((c + d*x^2 
)^(q + 1)/(2*b*(b*c - a*d)*(p + 1))), x] + Simp[e^4/(2*b*(b*c - a*d)*(p + 1 
))   Int[(e*x)^(m - 4)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[a*c*(m - 3) + 
 (a*d*(m + 2*q - 1) + 2*b*c*(p + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, 
e, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[m, 3] && IntBinomialQ[a 
, b, c, d, e, m, 2, p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
3.3.31.4 Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.95

method result size
derivativedivides \(\frac {\frac {a \left (-\frac {\left (a -b \right ) \tan \left (f x +e \right )}{2 b \left (a +b \tan \left (f x +e \right )^{2}\right )}+\frac {\left (a -3 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 b \sqrt {a b}}\right )}{\left (a -b \right )^{2}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{\left (a -b \right )^{2}}}{f}\) \(90\)
default \(\frac {\frac {a \left (-\frac {\left (a -b \right ) \tan \left (f x +e \right )}{2 b \left (a +b \tan \left (f x +e \right )^{2}\right )}+\frac {\left (a -3 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 b \sqrt {a b}}\right )}{\left (a -b \right )^{2}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{\left (a -b \right )^{2}}}{f}\) \(90\)
risch \(\frac {x}{a^{2}-2 a b +b^{2}}-\frac {i a \left (a \,{\mathrm e}^{2 i \left (f x +e \right )}+b \,{\mathrm e}^{2 i \left (f x +e \right )}+a -b \right )}{f \left (a -b \right )^{2} b \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}-b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a -b \right )}+\frac {\sqrt {-a b}\, a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{4 b^{2} \left (a -b \right )^{2} f}-\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{4 b \left (a -b \right )^{2} f}-\frac {\sqrt {-a b}\, a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{4 b^{2} \left (a -b \right )^{2} f}+\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{4 b \left (a -b \right )^{2} f}\) \(335\)

input
int(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 
output
1/f*(a/(a-b)^2*(-1/2*(a-b)/b*tan(f*x+e)/(a+b*tan(f*x+e)^2)+1/2*(a-3*b)/b/( 
a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2)))+1/(a-b)^2*arctan(tan(f*x+e)))
 
3.3.31.5 Fricas [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 381, normalized size of antiderivative = 4.01 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\left [\frac {8 \, b^{2} f x \tan \left (f x + e\right )^{2} + 8 \, a b f x - {\left ({\left (a b - 3 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} - 3 \, a b\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} - 4 \, {\left (b^{2} \tan \left (f x + e\right )^{3} - a b \tan \left (f x + e\right )\right )} \sqrt {-\frac {a}{b}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right ) - 4 \, {\left (a^{2} - a b\right )} \tan \left (f x + e\right )}{8 \, {\left ({\left (a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{3} b - 2 \, a^{2} b^{2} + a b^{3}\right )} f\right )}}, \frac {4 \, b^{2} f x \tan \left (f x + e\right )^{2} + 4 \, a b f x + {\left ({\left (a b - 3 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} - 3 \, a b\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt {\frac {a}{b}}}{2 \, a \tan \left (f x + e\right )}\right ) - 2 \, {\left (a^{2} - a b\right )} \tan \left (f x + e\right )}{4 \, {\left ({\left (a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{3} b - 2 \, a^{2} b^{2} + a b^{3}\right )} f\right )}}\right ] \]

input
integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")
 
output
[1/8*(8*b^2*f*x*tan(f*x + e)^2 + 8*a*b*f*x - ((a*b - 3*b^2)*tan(f*x + e)^2 
 + a^2 - 3*a*b)*sqrt(-a/b)*log((b^2*tan(f*x + e)^4 - 6*a*b*tan(f*x + e)^2 
+ a^2 - 4*(b^2*tan(f*x + e)^3 - a*b*tan(f*x + e))*sqrt(-a/b))/(b^2*tan(f*x 
 + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)) - 4*(a^2 - a*b)*tan(f*x + e))/((a^2 
*b^2 - 2*a*b^3 + b^4)*f*tan(f*x + e)^2 + (a^3*b - 2*a^2*b^2 + a*b^3)*f), 1 
/4*(4*b^2*f*x*tan(f*x + e)^2 + 4*a*b*f*x + ((a*b - 3*b^2)*tan(f*x + e)^2 + 
 a^2 - 3*a*b)*sqrt(a/b)*arctan(1/2*(b*tan(f*x + e)^2 - a)*sqrt(a/b)/(a*tan 
(f*x + e))) - 2*(a^2 - a*b)*tan(f*x + e))/((a^2*b^2 - 2*a*b^3 + b^4)*f*tan 
(f*x + e)^2 + (a^3*b - 2*a^2*b^2 + a*b^3)*f)]
 
3.3.31.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2157 vs. \(2 (78) = 156\).

Time = 14.51 (sec) , antiderivative size = 2157, normalized size of antiderivative = 22.71 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \]

input
integrate(tan(f*x+e)**4/(a+b*tan(f*x+e)**2)**2,x)
 
output
Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((x + tan(e + f*x)**3/( 
3*f) - tan(e + f*x)/f)/a**2, Eq(b, 0)), (x/b**2, Eq(a, 0)), (3*f*x*tan(e + 
 f*x)**4/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x)**2 + 8*b**2*f) 
 + 6*f*x*tan(e + f*x)**2/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x 
)**2 + 8*b**2*f) + 3*f*x/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x 
)**2 + 8*b**2*f) - 5*tan(e + f*x)**3/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f 
*tan(e + f*x)**2 + 8*b**2*f) - 3*tan(e + f*x)/(8*b**2*f*tan(e + f*x)**4 + 
16*b**2*f*tan(e + f*x)**2 + 8*b**2*f), Eq(a, b)), (x*tan(e)**4/(a + b*tan( 
e)**2)**2, Eq(f, 0)), (a**3*log(-sqrt(-a/b) + tan(e + f*x))/(4*a**3*b**2*f 
*sqrt(-a/b) + 4*a**2*b**3*f*sqrt(-a/b)*tan(e + f*x)**2 - 8*a**2*b**3*f*sqr 
t(-a/b) - 8*a*b**4*f*sqrt(-a/b)*tan(e + f*x)**2 + 4*a*b**4*f*sqrt(-a/b) + 
4*b**5*f*sqrt(-a/b)*tan(e + f*x)**2) - a**3*log(sqrt(-a/b) + tan(e + f*x)) 
/(4*a**3*b**2*f*sqrt(-a/b) + 4*a**2*b**3*f*sqrt(-a/b)*tan(e + f*x)**2 - 8* 
a**2*b**3*f*sqrt(-a/b) - 8*a*b**4*f*sqrt(-a/b)*tan(e + f*x)**2 + 4*a*b**4* 
f*sqrt(-a/b) + 4*b**5*f*sqrt(-a/b)*tan(e + f*x)**2) - 2*a**2*b*sqrt(-a/b)* 
tan(e + f*x)/(4*a**3*b**2*f*sqrt(-a/b) + 4*a**2*b**3*f*sqrt(-a/b)*tan(e + 
f*x)**2 - 8*a**2*b**3*f*sqrt(-a/b) - 8*a*b**4*f*sqrt(-a/b)*tan(e + f*x)**2 
 + 4*a*b**4*f*sqrt(-a/b) + 4*b**5*f*sqrt(-a/b)*tan(e + f*x)**2) + a**2*b*l 
og(-sqrt(-a/b) + tan(e + f*x))*tan(e + f*x)**2/(4*a**3*b**2*f*sqrt(-a/b) + 
 4*a**2*b**3*f*sqrt(-a/b)*tan(e + f*x)**2 - 8*a**2*b**3*f*sqrt(-a/b) - ...
 
3.3.31.7 Maxima [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.20 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=-\frac {\frac {a \tan \left (f x + e\right )}{a^{2} b - a b^{2} + {\left (a b^{2} - b^{3}\right )} \tan \left (f x + e\right )^{2}} - \frac {{\left (a^{2} - 3 \, a b\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \sqrt {a b}} - \frac {2 \, {\left (f x + e\right )}}{a^{2} - 2 \, a b + b^{2}}}{2 \, f} \]

input
integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")
 
output
-1/2*(a*tan(f*x + e)/(a^2*b - a*b^2 + (a*b^2 - b^3)*tan(f*x + e)^2) - (a^2 
 - 3*a*b)*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^2*b - 2*a*b^2 + b^3)*sqrt(a 
*b)) - 2*(f*x + e)/(a^2 - 2*a*b + b^2))/f
 
3.3.31.8 Giac [A] (verification not implemented)

Time = 1.09 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.28 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {\frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} {\left (a^{2} - 3 \, a b\right )}}{{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \sqrt {a b}} + \frac {2 \, {\left (f x + e\right )}}{a^{2} - 2 \, a b + b^{2}} - \frac {a \tan \left (f x + e\right )}{{\left (b \tan \left (f x + e\right )^{2} + a\right )} {\left (a b - b^{2}\right )}}}{2 \, f} \]

input
integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
 
output
1/2*((pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt(a*b 
)))*(a^2 - 3*a*b)/((a^2*b - 2*a*b^2 + b^3)*sqrt(a*b)) + 2*(f*x + e)/(a^2 - 
 2*a*b + b^2) - a*tan(f*x + e)/((b*tan(f*x + e)^2 + a)*(a*b - b^2)))/f
 
3.3.31.9 Mupad [B] (verification not implemented)

Time = 13.33 (sec) , antiderivative size = 2358, normalized size of antiderivative = 24.82 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \]

input
int(tan(e + f*x)^4/(a + b*tan(e + f*x)^2)^2,x)
 
output
(2*atan((((((2*a*b^6 - 8*a^2*b^5 + 12*a^3*b^4 - 8*a^4*b^3 + 2*a^5*b^2)*1i) 
/(3*a*b^3 + a^3*b - b^4 - 3*a^2*b^2) - (tan(e + f*x)*(16*b^8 - 48*a*b^7 + 
32*a^2*b^6 + 32*a^3*b^5 - 48*a^4*b^4 + 16*a^5*b^3))/(2*(a^2*b - 2*a*b^2 + 
b^3)*(2*a^2 - 4*a*b + 2*b^2)))/(2*a^2 - 4*a*b + 2*b^2) + (tan(e + f*x)*(a^ 
4 - 6*a^3*b + 4*b^4 + 9*a^2*b^2))/(2*(a^2*b - 2*a*b^2 + b^3)))/(2*a^2 - 4* 
a*b + 2*b^2) - ((((2*a*b^6 - 8*a^2*b^5 + 12*a^3*b^4 - 8*a^4*b^3 + 2*a^5*b^ 
2)*1i)/(3*a*b^3 + a^3*b - b^4 - 3*a^2*b^2) + (tan(e + f*x)*(16*b^8 - 48*a* 
b^7 + 32*a^2*b^6 + 32*a^3*b^5 - 48*a^4*b^4 + 16*a^5*b^3))/(2*(a^2*b - 2*a* 
b^2 + b^3)*(2*a^2 - 4*a*b + 2*b^2)))/(2*a^2 - 4*a*b + 2*b^2) - (tan(e + f* 
x)*(a^4 - 6*a^3*b + 4*b^4 + 9*a^2*b^2))/(2*(a^2*b - 2*a*b^2 + b^3)))/(2*a^ 
2 - 4*a*b + 2*b^2))/((((((2*a*b^6 - 8*a^2*b^5 + 12*a^3*b^4 - 8*a^4*b^3 + 2 
*a^5*b^2)*1i)/(3*a*b^3 + a^3*b - b^4 - 3*a^2*b^2) - (tan(e + f*x)*(16*b^8 
- 48*a*b^7 + 32*a^2*b^6 + 32*a^3*b^5 - 48*a^4*b^4 + 16*a^5*b^3))/(2*(a^2*b 
 - 2*a*b^2 + b^3)*(2*a^2 - 4*a*b + 2*b^2)))*1i)/(2*a^2 - 4*a*b + 2*b^2) + 
(tan(e + f*x)*(a^4 - 6*a^3*b + 4*b^4 + 9*a^2*b^2)*1i)/(2*(a^2*b - 2*a*b^2 
+ b^3)))/(2*a^2 - 4*a*b + 2*b^2) + (((((2*a*b^6 - 8*a^2*b^5 + 12*a^3*b^4 - 
 8*a^4*b^3 + 2*a^5*b^2)*1i)/(3*a*b^3 + a^3*b - b^4 - 3*a^2*b^2) + (tan(e + 
 f*x)*(16*b^8 - 48*a*b^7 + 32*a^2*b^6 + 32*a^3*b^5 - 48*a^4*b^4 + 16*a^5*b 
^3))/(2*(a^2*b - 2*a*b^2 + b^3)*(2*a^2 - 4*a*b + 2*b^2)))*1i)/(2*a^2 - 4*a 
*b + 2*b^2) - (tan(e + f*x)*(a^4 - 6*a^3*b + 4*b^4 + 9*a^2*b^2)*1i)/(2*...